use actix_web::web;
use crate::handlers::course::*;
use crate::handlers::health_check::*;

pub fn route_config(cfg: &mut web::ServiceConfig) {
    cfg.route("health", web::get().to(health_check_handler));
}


pub fn course_route(cfg: &mut web::ServiceConfig) {
    cfg
        .service(web::scope("/courses")  //   设置作用域
            .route("/add", web::post().to(add_course))
            .route("/get_by_teacher/{teacher_id}", web::get().to(get_course_by_teacher))
            .route("/get_detail/{course_id}", web::get().to(get_course_detail))
        );
}